﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace MvcMembership
{
	public class GlobalApplication : System.Web.HttpApplication
	{

		public static void RegisterRoutes( RouteCollection routes )
		{

			// Note: Change the URL to "{controller}.mvc/{action}/{id}" to enable
			//       automatic support on IIS6 and IIS7 classic mode

			StarterKits.Mvc.Membership.Controllers.BaseFormsAuthenticationAdministrationController.RegisterDefaultRoutes( routes, "Security", "FormsAuthenticationAdministration", null ); //change null to ".mvc" for IIS6
			StarterKits.Mvc.Membership.Controllers.BaseFormsAuthenticationController.RegisterDefaultFormsRoutes( routes, "FormsAuthentication", null ); //change null to ".mvc" for IIS6
			StarterKits.Mvc.Membership.Controllers.BaseFormsAuthenticationController.RegisterDefaultOpenIDRoutes( routes, "FormsAuthentication", null ); //change null to ".mvc" for IIS6

			routes.MapRoute( "Default",
								"{controller}/{action}/{id}",
								new { controller = "Home", action = "Index", id = "" },
								new { controller = @"[^\.]*" } );
			routes.MapRoute( "Homepage",
								"Default.aspx",
								new { controller = "Home", action = "Index", id = "" } );

		}

		protected void Application_Start( object sender, EventArgs e )
		{
			RegisterRoutes( RouteTable.Routes );
		}

	}
}